from django.db import models


class News(models.Model):
    title = models.CharField(max_length=256, verbose_name='标题')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='发布日期')
    content = models.TextField(verbose_name='新闻内容')
    avatar = models.FileField(upload_to='new', default='', verbose_name='图片')
    is_delete = models.BooleanField(default=False, verbose_name='是否删除')

    class Meta:
        db_table = 'swim_news'
        verbose_name_plural = '新闻'
    def __str__(self):
        return self.title
